package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextField;

public class SearchForm {

	
	private JTextField JTextFieldFname;
    private JTextField JTextFieldLname;
    private JTextField JTextFieldEmailPers;

//    private JLabel JLabelFname;
//    private JLabel JLabelLname;
//    private JLabel JLabelEmailPers;

    private JButton JButtonValidate;
    public static JFrame jframe1;
    private JMenuBar jmenu;
    private JMenu Option;
    private JMenuItem Quitter;
    
    private final String cols[] = {"First Name", "Last Name", "Personal Email"};
    
    public SearchForm(){
    	
    }
    
    public void Menu() {

        jframe1 = new javax.swing.JFrame();
        JTextFieldFname = new javax.swing.JTextField();
        JTextFieldLname = new javax.swing.JTextField();
        JTextFieldEmailPers = new javax.swing.JTextField();

        JButtonValidate = new javax.swing.JButton();
        jmenu = new javax.swing.JMenuBar();
        Option = new javax.swing.JMenu("Option");
        Quitter = new javax.swing.JMenuItem("Quitter");


        // Affichage de la jdialog affichait de base
        jframe1.setTitle("__ :: Address Book :: __");
        jframe1.setMinimumSize(new java.awt.Dimension(180, 250));
        jframe1.setResizable(false);
        jframe1.setLayout(null);

        // Affichage des boutons des IA
        JTextFieldFname.setText(cols[0]);
        jframe1.getContentPane().add(JTextFieldFname);
        JTextFieldFname.setBounds(10, 10, 145, 23);

        JTextFieldLname.setText(cols[1]);
        jframe1.getContentPane().add(JTextFieldLname);
        JTextFieldLname.setBounds(10, 60, 145, 23);

        JTextFieldEmailPers.setText(cols[2]);
        jframe1.getContentPane().add(JTextFieldEmailPers);
        JTextFieldEmailPers.setBounds(10, 110, 145, 23);
        
        JButtonValidate.setText("Send");
        jframe1.getContentPane().add(JButtonValidate);
        JButtonValidate.setBounds(10, 160, 145, 23);


        // Ajout des sous menu de Option
        Option.add(Quitter);
        
        Quitter.setMnemonic(KeyEvent.VK_Q);
        Option.setMnemonic(KeyEvent.VK_ALT);

        // Ajouter les menu sur la bar de menu
        jmenu.add(Option);
        
        
        

        // On gere les clics de la souris pour notre menu
        Quitter.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                System.exit(0);
            }
        });


        // On affiche gere la fenetre
       // jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Vue/Images/FondAcceuil12.jpg"))); // NOI18N
//        jLabel1.setText("jLabel1");
//        jframe1.Fname(jLabel1);
//        jLabel1.setBounds(0, 0, 900, 599);

        // On met le bar menu
        jframe1.setJMenuBar(jmenu);
        jframe1.setVisible(true);
    }

	/**
	 * @return the jTextFieldFname
	 */
	public JTextField getJTextFieldFname() {
		return JTextFieldFname;
	}

	/**
	 * @param jTextFieldFname the jTextFieldFname to set
	 */
	public void setJTextFieldFname(JTextField jTextFieldFname) {
		JTextFieldFname = jTextFieldFname;
	}

	/**
	 * @return the jTextFieldLname
	 */
	public JTextField getJTextFieldLname() {
		return JTextFieldLname;
	}

	/**
	 * @param jTextFieldLname the jTextFieldLname to set
	 */
	public void setJTextFieldLname(JTextField jTextFieldLname) {
		JTextFieldLname = jTextFieldLname;
	}

	/**
	 * @return the jTextFieldEmailPers
	 */
	public JTextField getJTextFieldEmailPers() {
		return JTextFieldEmailPers;
	}

	/**
	 * @param jTextFieldEmailPers the jTextFieldEmailPers to set
	 */
	public void setJTextFieldEmailPers(JTextField jTextFieldEmailPers) {
		JTextFieldEmailPers = jTextFieldEmailPers;
	}

	/**
	 * @return the jButtonValidate
	 */
	public JButton getJButtonValidate() {
		return JButtonValidate;
	}

	/**
	 * @param jButtonValidate the jButtonValidate to set
	 */
	public void setJButtonValidate(JButton jButtonValidate) {
		JButtonValidate = jButtonValidate;
	}

	/**
	 * @return the jframe1
	 */
	public JFrame getJframe1() {
		return jframe1;
	}

	/**
	 * @param jframe1 the jframe1 to set
	 */
	public void setJframe1(JFrame jframe1) {
		this.jframe1 = jframe1;
	}

	/**
	 * @return the jmenu
	 */
	public JMenuBar getJmenu() {
		return jmenu;
	}

	/**
	 * @param jmenu the jmenu to set
	 */
	public void setJmenu(JMenuBar jmenu) {
		this.jmenu = jmenu;
	}
}
